//
// Copyright (c) 2024 BPer
//
#ifndef BPERCAPTURE_SRC_BPERAUDIOCAPTUREIMPL_H_
#define BPERCAPTURE_SRC_BPERAUDIOCAPTUREIMPL_H_
#include <bperaudiodev/BPerAudioCaptureHandle.h>
#include <bperavutil/audio/BPerPreProcess.h>
#include <bperaudiodev/BPerAudioCapture.h>
#include <vector>

#if BPer_OS_ANDROID
#include <bperaudiodev/android/BPerAudioAndroid.h>

using namespace std;

class BPerAudioCaptureAndroid: public BPerAudioCapture {
public:
	BPerAudioCaptureAndroid(BPerAVInfo *avinfo);
	~BPerAudioCaptureAndroid();
public:
	BPerAudioCaptureHandle *m_ahandle;
	int32_t init();
	void setPreProcess(BPerPreProcess *pp);
	void setCatureStart();
	void setCatureStop();
	void setOutAudioBuffer(BPerAudioBuffer *pbuffer);
	void setPlayAudoBuffer(BPerAudioBuffer *pbuffer);
	void setInAudioBuffer(vector<BPerAudioPlayBuffer*> *pal);
	void setAec(BPerRtcAec *paec);


protected:
	void startLoop();
	void stopLoop();
	void closeAudio();
 	BPerAudioAndroid* m_audioAndroid;
private:
	int32_t m_size;
	int32_t m_loops;
	int32_t m_channel;
	uint32_t  m_sample;
};
#endif
#endif /* BPERCAPTURE_SRC_BPERAUDIOCAPTUREIMPL_H_ */
